package com.yidu.DatelessManagement.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 净值统计实体类
 * @author 任俊杰
 * @version 1.0
 * @date 2022/12/27
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class NetWorth {
    private String projectName;// 项目名称
    private String parentProjectName;//父项目名
    private String fundId;//基金id 外键 备注：基金公司发行的基金代码
    private String projectId;//-- 项目代码
    private int shareNum;//票面值(数量) 标识
    private double stopPrice;//行情价格 备注：收盘价格
    private double capital;// -- 成本
    private double marketValue;//市值 备注：股票数量* 收盘价
    private double estimate;// 估值增值 备注：盈亏情况
    private String createTime;//-- 生成时间
    private int sortId;// 用来给净值对应数据排序排序


    /**
     * 用于初始化现金（净值统计）
     *
     * @param projectName       项目名
     * @param parentProjectName 父项目名称
     * @param fundId            基金id
     * @param projectId 银行卡卡号
     * @param capital 总余额
     * @param createTime 创建时间
     */
    public NetWorth(String projectName, String parentProjectName, String fundId, String projectId, double capital, String createTime) {
        this.projectName = projectName;
        this.parentProjectName = parentProjectName;
        this.fundId = fundId;
        this.projectId = projectId;
        this.capital = capital;
        this.createTime = createTime;
    }

    /**
     * 初始化现金下的子模块
     * @param projectName 项目名
     * @param parentProjectName 父项目名称
     * @param fundId 基金id
     * @param capital 总余额
     * @param createTime 创建时间
     */
    public NetWorth(String projectName, String parentProjectName, String fundId, double capital, String createTime) {
        this.projectName = projectName;
        this.parentProjectName = parentProjectName;
        this.fundId = fundId;
        this.capital = capital;
        this.createTime = createTime;
    }

    /**
     * 用来初始化父模块的净值统计
     *
     * @param projectName       项目名
     * @param parentProjectName 项目名称
     * @param fundId            基金id
     * @param createTime        创建时间
     * @param sortId            排序id
     */
    public NetWorth(String projectName, String parentProjectName, String fundId, String createTime, int sortId) {
        this.projectName = projectName;
        this.parentProjectName = parentProjectName;
        this.fundId = fundId;
        this.createTime = createTime;
        this.sortId = sortId;
    }


    /**
     * 用于初始化子模块的净值统计
     *
     * @param projectName       项目名
     * @param parentProjectName 父项目名
     * @param fundId            基金id
     * @param projectId         项目代码
     * @param shareNum          数量
     * @param stopPrice         行情价
     * @param capital           成本价
     * @param marketValue       市值
     * @param estimate          估值增值
     * @param createTime        创建时间
     */
    public NetWorth(String projectName, String parentProjectName, String fundId, String projectId, int shareNum, double stopPrice, double capital, double marketValue, double estimate, String createTime) {
        this.projectName = projectName;
        this.parentProjectName = parentProjectName;
        this.fundId = fundId;
        this.projectId = projectId;
        this.shareNum = shareNum;
        this.stopPrice = stopPrice;
        this.capital = capital;
        this.marketValue = marketValue;
        this.estimate = estimate;
        this.createTime = createTime;
    }

}
